<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 模版字符串 ``; 称为模版字符串
      // ${} ---> 插值表达式。{{}}  {}  #{} <%= %>  {$变量}
      // 插值表达式使用；1.可以解析变量 2.做一些简单的运算 3.接收有返回值的逻辑
      // let name = '张三';
      let age = 20;
      let str = `大家好我是${name}我的年龄是${10 + 10}`;
      console.log(str);
      const f = (v) => v;
      let flag = true;
      document.onclick = function () {
        document.body.innerHTML = `我的名字是${flag ? `张三` : `李四`}`;
        let str = `hello 大家好 ${f(`你好`)}`;
        console.log(str);
        let str2 = "你好 ${if(flag){}else{}}";
        flag = !flag;
      };
    </script>
  </body>
</html>
